
/**
 * @file    WebWindowImpl.h
 * @brief   
 * @date    2004-12-29 15:55:23
 * @author  GengYong (gengyong@gmail.com)
 *
 */

#ifndef WEBWINDOW_HEADER_WEBWINDOWIMPL_H
#define WEBWINDOW_HEADER_WEBWINDOWIMPL_H
//----------------------------------------------------------

#include <mshtmhst.h>
#include <commctrl.h>
#include <exdisp.h>
#include "WebWindow.h"

namespace xessage_private {
	class WebWindowImpl:public xessage::IWebWindow
	{
	public:
		WebWindowImpl();
		virtual ~WebWindowImpl();
	public:
		virtual bool OutputPage(const char * url);
		virtual bool OutputPage(const wchar_t * url);
		virtual bool OutputText(const char * text);
		virtual bool OutputText(const wchar_t * text);
		virtual bool OutputStream(IStream * stream);
		virtual bool Attach(HWND hwnd, int options = 0);
		virtual void AdjustWindow(long width, long height);
		virtual bool LoadingFinished();
		virtual bool GetHtmlDocument(IHTMLDocument2 ** lplpDocument);
		virtual bool GetHtmlWindow(IHTMLWindow2 ** lplpWindow);
		virtual xessage::IEventHandler * RegistEventHandler(xessage::IEventHandler * handler);
		virtual xessage::IExternalDispatcher * RegistExternalDispatcher(xessage::IExternalDispatcher * dispatcher);
	public:
		virtual xessage::IEventHandler * GetEventHandler();
		virtual xessage::IExternalDispatcher * GetExternalDispatcher();
	private:
		xessage::IEventHandler *		m_eventHandler;
		xessage::IExternalDispatcher *	m_externalDispatcher;
		IOleObject		*				m_iOleObject;
		IWebBrowser2	*				m_iWebBrowser;
		IConnectionPoint*				m_iConnectionPoint;
		DWORD							m_dwEventCookie;
		IOleClientSite	*				m_iClientSite;
		IStorage		*				m_iStorage;
		IDispatch		*				m_iWebEventHandler;
	};
}

//----------------------------------------------------------
#endif	//#ifndef WEBWINDOW_HEADER_WEBWINDOWIMPL_H

